package com.ocl.www.service;

import com.ocl.www.domain.UserFavorite;
import com.ocl.www.mapper.UserFavoriteMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserFavoriteService {

    @Autowired
    private UserFavoriteMapper userFavoriteMapper;

    public int insertFavorite(UserFavorite userFavorite) throws  Exception{

        int c = userFavoriteMapper.insertFavorite(userFavorite);

        return c;
    }


    public int deleteFavorite(UserFavorite userFavorite) throws  Exception{

        int c = userFavoriteMapper.deleteFavorite(userFavorite);

        return c;
    }


    public List<UserFavorite> selectFavorites(UserFavorite userFavorite) throws  Exception{

        List<UserFavorite> userFavoriteslist = userFavoriteMapper.selectFavorites(userFavorite);

        return userFavoriteslist;
    }

    public List<UserFavorite> selectFavoritesCount(UserFavorite userFavorite)  throws Exception{
        return userFavoriteMapper.selectFavoritesCount(userFavorite);
    }
}
